package com.dublbo.addressbook.frame;

import com.dublbo.jpSwing.JpButton;
import com.dublbo.jpSwing.JpEditText;
import com.dublbo.jpSwing.JpPanel;
import com.dublbo.jpSwing.layout.JpRowLayout;

import javax.swing.*;
import java.awt.*;

public class GroupNavPanel extends JpPanel {
    public JpButton addGroupBtn = new JpButton("新建组");
    public JpButton editGroupBtn = new JpButton("编辑组");
    public JpButton delGroupBtn = new JpButton("删除组");
    public JpButton copyToGroupBtn = new JpButton("复制到组 ∨");
    public JpButton moveToGroupBtn = new JpButton("移动到组 ∨");
    public JpButton delPersonBtn = new JpButton("删除");
    public JpButton reloadBtn = new JpButton("刷新");
    public JpEditText searchEdit = new JpEditText();
    public JpButton searchBtn = new JpButton("查询");

    public GroupNavPanel(){
        this.setLayout(new JpRowLayout(4));
        this.padding(5);
        this.preferredHeight(50);
        this.setBgColor(Color.darkGray);

        this.add(addGroupBtn);
        this.add(editGroupBtn);
        this.add(delGroupBtn);
        this.add(new JLabel(),"10px");
        this.add(copyToGroupBtn);
        this.add(moveToGroupBtn);
        this.add(delPersonBtn);
        this.add(reloadBtn);

        this.add(new JLabel(), "20px");
        this.add(searchEdit, "200px");
        this.add(searchBtn, "auto");

        addGroupBtn.setCursor(new Cursor(Cursor.HAND_CURSOR));
        editGroupBtn.setCursor(new Cursor(Cursor.HAND_CURSOR));
        delGroupBtn.setCursor(new Cursor(Cursor.HAND_CURSOR));
        copyToGroupBtn.setCursor(new Cursor(Cursor.HAND_CURSOR));
        moveToGroupBtn.setCursor(new Cursor(Cursor.HAND_CURSOR));
        delPersonBtn.setCursor(new Cursor(Cursor.HAND_CURSOR));
        reloadBtn.setCursor(new Cursor(Cursor.HAND_CURSOR));
        searchBtn.setCursor(new Cursor(Cursor.HAND_CURSOR));
        searchEdit.setFont(new Font("微软雅黑", Font.PLAIN, 16));
        searchEdit.setPlaceHolder(" 搜索所有联系人");
    }
}
